# -*- coding: utf-8 -*-

################################################################################
## Form generated from reading UI file '多行文本实例.ui'
##
## Created by: Qt User Interface Compiler version 5.15.2
##
## WARNING! All changes made in this file will be lost when recompiling UI file!
################################################################################

from PySide2.QtCore import *
from PySide2.QtGui import *
from PySide2.QtWidgets import *
import sys
from PySide2 import QtGui, QtWidgets

class Ui_MainWindow(object):
    def setupUi(self, MainWindow):
        if not MainWindow.objectName():
            MainWindow.setObjectName(u"MainWindow")
        MainWindow.resize(800, 600)
        self.centralwidget = QWidget(MainWindow)
        self.centralwidget.setObjectName(u"centralwidget")
        self.textEdit_plain = QTextEdit(self.centralwidget)
        self.textEdit_plain.setObjectName(u"textEdit_plain")
        self.textEdit_plain.setGeometry(QRect(90, 130, 251, 261))

        # 设置 多行纯文本输入
        self.textEdit_plain.setPlainText("与失败比起来，我对乏味和平庸的恐惧要严重很多。"
                                         "对我而言，很好的事要比糟糕的事好，而糟糕的事要比平庸的事好，"
                                         "因为糟糕的事至少给生活增添了滋味")
        # 获取多行文本的内容
        print(self.textEdit_plain.toPlainText())

        self.textEdit_html = QTextEdit(self.centralwidget)
        self.textEdit_html.setObjectName(u"textEdit_html")
        self.textEdit_html.setGeometry(QRect(430, 130, 261, 261))

        # 设置 多行html文本
        self.textEdit_html.setHtml("与失败比起来，我对乏味和平庸的恐惧要严重很多。"
                                   "对我而言，<font color='red' size=12>很好的事要比糟糕的事好，而糟糕的事要比平庸的事好，</font>"
                                   "因为糟糕的事至少给生活增添了滋味"
                                   "<a href='www.baidu.com'><img src='百度.png'></a>")


        self.label = QLabel(self.centralwidget)
        self.label.setObjectName(u"label")
        self.label.setGeometry(QRect(90, 90, 81, 31))
        self.label_2 = QLabel(self.centralwidget)
        self.label_2.setObjectName(u"label_2")
        self.label_2.setGeometry(QRect(430, 90, 81, 31))
        MainWindow.setCentralWidget(self.centralwidget)
        self.menubar = QMenuBar(MainWindow)
        self.menubar.setObjectName(u"menubar")
        self.menubar.setGeometry(QRect(0, 0, 800, 26))
        MainWindow.setMenuBar(self.menubar)
        self.statusbar = QStatusBar(MainWindow)
        self.statusbar.setObjectName(u"statusbar")
        MainWindow.setStatusBar(self.statusbar)

        self.retranslateUi(MainWindow)

        QMetaObject.connectSlotsByName(MainWindow)
    # setupUi

    def retranslateUi(self, MainWindow):
        MainWindow.setWindowTitle(QCoreApplication.translate("MainWindow", u"TextEdit\u5e94\u7528", None))
        self.label.setText(QCoreApplication.translate("MainWindow", u"\u7eaf\u6587\u672c\uff1a", None))
        self.label_2.setText(QCoreApplication.translate("MainWindow", u"HTML\u6587\u672c", None))
    # retranslateUi


if __name__ == '__main__':
    app = QtWidgets.QApplication(sys.argv)
    MainWindow = QtWidgets.QMainWindow()
    ui = Ui_MainWindow()
    ui.setupUi(MainWindow)
    MainWindow.show()
    sys.exit(app.exec_())

